import React, { Component } from 'react';
import { getInfo } from '../../api/login';
import { Button } from 'antd';
import './Login.scss'
class Login extends Component {
	goHomePage = async () => {
		let res = await getInfo()
		if (res.meta.status === 200) {
			sessionStorage.setItem('token', 'token')
			window.location.href = '/'
		} else {
			
		}


	}

	componentDidMount() {


	}




	render() {
		return (
			<div>
				<div className="loginBox">
					<div className="userBox">
						账户：<input type="text" />
					</div>
					<div className="passwordBox">
						密码：<input type="password" />
					</div>
					<div>
						<Button type="primary" onClick={this.goHomePage}>登录</Button>
					</div>
				</div>
			</div>
		);
	}
}

export default Login;